﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace QuaManSys
{
    public class CommonInitFunctions
    {
        /*
         * 从数据库中获得工程号时projNo的机型号
         */
        public static string getMachModelNo(string projNo)
        {
            using (var context = new QuaManSysEntities())
            {          
                    var result = from c in context.Tab_ProjectNo
                                 where projNo == c.projectNo
                                 select c;
                   return result.Single().machinemodelNo;                
            }
        }

        /*
         * 从数据库中获得工程号时projNo的机号
         */
        public static string getMachineNo(string projNo)
        {
            using (QuaManSysEntities context = new QuaManSysEntities())
            {
                var result = from c in context.Tab_ProjectNo
                             where projNo == c.projectNo
                             select c;
                return result.Single().machineNo;
            }
        }


    }
}